﻿
var connection = require("../../app_modules/dbAccess/mongoConfig.js");
var mongoose = require('mongoose');
var db = mongoose.createConnection(connection.getConnectionString("")); //连接test数据库
//var db = mongoose.Connection(connection.getConnectionString(""));

var Schema = mongoose.Schema; //创建模型【骨架模板】
var navImageSchema = new Schema({
    typeCode: String,
    typeName: String,
    filename: String,
});

navImageSchema.methods.add = function (navImage, callback) {
    this.typeCode = navImage.typeCode;
    this.typeName = navImage.typeName;
    this.filename = navImage.filename;
    this.save(callback);
}
var navImage = db.model('navImages', navImageSchema);
module.exports = navImage;
